/**
 * Created by huangchuang on 2017/6/15 0015.
 */
import {signIn, signInIdm, getEnterpriseUrl, scanloginCallback} from '@/service/getData'
const state = {
  epLoginUrl: '' // 企业登录url
}
const actions = {
  async signInIdm ({commit, state}, payload) {
    let res = await signInIdm(payload)
    return res.data
  },
  async getEnterpriseUrl ({commit, state}, payload) {
    let res = await getEnterpriseUrl(payload)
    commit('SET_EP_URL', res.data.data)
    return res.data.data
  },
  async scanloginCallback ({commit, state}, payload) {
    let res = await scanloginCallback(payload)
    return res
  }
}
const mutations = {
  ['SET_EP_URL'] (state, payload) {
    state.epLoginUrl = payload
  }
}
export default {state, actions, mutations}
